﻿@model IEnumerable<KKU.RBSFPP.Shared.DAC.Member>

@{
    ViewBag.Title = "Index";
}

@Html.Partial("_AccountMenu")

<p>
    <a href=@Url.Action("Create", "Member") class="btn btn-success"><span class="glyphicon glyphicon-plus"></span> เพิ่มบัญชีผู้ใช้</a>
    @*<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
        Launch demo modal
    </button>
    <a data-toggle="modal" href="http://localhost:42992/Member/Create" data-target="#myModal">Click me</a>*@
</p>

<table class="table table-hover">
    <tr>
        <th>สิทธิ์</th>
        <th>รหัสประจำตัวประชาชน</th>
        <th>ชื่อผู้ใช้</th>
        <th>ชื่อ</th>
        <th>นามสกุล</th>
        <th>ที่อยู่</th>
        <th>เบอร์โทรศัพท์</th>
        <th>สร้างเมื่อวันที่</th>
        @*<th>ลบเมื่อวันที่</th>*@
        <th>คำสั่ง</th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>@Html.DisplayFor(modelItem => item.PrivilegeLevel.Name)</td>
        <td>@Html.DisplayFor(modelItem => item.PersonalId)</td>
        <td>@Html.DisplayFor(modelItem => item.Username)</td>
        <td>@Html.DisplayFor(modelItem => item.FirstName)</td>
        <td>@Html.DisplayFor(modelItem => item.LastName)</td>
        <td>@Html.DisplayFor(modelItem => item.Address)</td>
        <td>@Html.DisplayFor(modelItem => item.TelephoneNumber)</td>
        <td>@Html.DisplayFor(modelItem => item.CreateOn)</td>
        @*<td>@Html.DisplayFor(modelItem => item.DeleteOn)</td>*@
        <td>
           <div class="btn btn-default"> @Html.ActionLink("แก้ไข", "Edit", new { id=item.Id }) </div>
           @*<div class="btn btn-default"> @Html.ActionLink("รายละเอียด", "Details", new { id=item.Id })</div> *@
           <div class="btn btn-default">@Html.ActionLink("ลบ", "Delete", new { id=item.Id })</div>
        </td>
    </tr>
}

</table>


<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Modal title</h4>
            </div>
            <div class="modal-body">
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary">Save changes</button>
            </div>
        </div>
    </div>
</div>